package com.example.demo.mapper;

import com.example.demo.model.Material;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

/**
 * Created by Administrator on 2018/12/26.
 */
@Mapper
public interface SpringBootMapper {
    @Select("select * from material")
    List<Material> queryAll();


    @SelectProvider(type = DynamicJoin.class,method = "zhuJieBatchQueryMaterials")
    List<Material> zhuJieBatchQueryAllByIds(@Param("list") List<Integer> ids);

    List<Material> batchQueryMaterials(List<Integer> ids);

    int batchAddMaterials(List<Material> materials);

    int batchDeleteMaterialsByIds(List<Integer> ids);

    int batchUpdateMaterialByIds(List<Material> materials);

}
